package main

import (
	"log"
	"os"
	"io/ioutil"
	"strings"
)

func main(){
	counts := make(map[string]int)
	files  := os.Args[1:]

	data, err := ioutil.ReadFile(files[0])		
	if err != nil {
		log.Println(os.Stderr, err)
	}

	for _, line := range strings.Split(string(data), "\n"){
		strings.TrimSpace(line)
		counts[line]++
	}

	for str, n := range counts{		
		if n > 1 {
			log.Println(n, str)
		}
	}
}